package com.mitaotao._1_语法._3_分支._3_if判断;

import java.util.Scanner;

public class _01_根据成绩输出等级_2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入成绩等级：");
        //定义一个变量接收传入的内容
        String level = scanner.nextLine();
        String grade;
        //nextLine可以识别空格
        //判断传入的内容
        switch (level){
            case"A":
                grade = "优秀";
                break;//可选
            case"B":
                grade = "良好";
                break;
            case"C":
                grade = "及格";
                break;
            case"D":
                grade = "不及格";
                break;
            default:
                grade = "未知等级！";
        }
        System.out.println(grade);
        scanner.close();
    }
}
